package com.code.coinprice.controllers;

import com.code.coinprice.services.CoinPriceDictService;
import com.code.coinprice.utils.ResponseUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/coin-price-dicts")
public class CoinPriceDictController {

    @Resource
    private CoinPriceDictService coinPriceDictService;

    /**
     * 获取字典值
     */
    @GetMapping("")
    public Object getDictKeyByDictValue(@RequestParam("dictKey") String dictKey) {
        return ResponseUtil.ok(coinPriceDictService.getDictValueByDictKey(dictKey));
    }

}
